package com.qd.common.panda.domain.entity.carpark;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 停车场费用设置记录
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class CarParkFeeLogDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "停车场费用设置记录";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "日志ID"})
    @NotBlank(message = "日志ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "日志ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String logId;
    /**
     * 设置ID
     */
    @ExcelProperty(value = {EXCEL_TITLE, "设置ID"})
    @NotBlank(message = "设置ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "设置ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String sid;
    /**
     * 说明
     */
    @ExcelProperty(value = {EXCEL_TITLE, "说明"})
    @Size(max = 200, message = "说明长度不能超过{max}位", groups = DefaultGroup.class)
    private String note;
    /**
     * 规则
     */
    @ExcelProperty(value = {EXCEL_TITLE, "规则"})
    @Size(max = 200, message = "规则长度不能超过{max}位", groups = DefaultGroup.class)
    private String rule;
    /**
     * 添加时间
     */
    @ExcelProperty(value = {EXCEL_TITLE, "添加时间"})
    @NotNull(message = "添加时间不能为空", groups = DefaultGroup.class)
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    @ExcelProperty(value = {EXCEL_TITLE, "更新时间"})
    private LocalDateTime updateTime;
    /**
     * 停车场计费规则
     */
    @ExcelProperty(value = {EXCEL_TITLE, "停车场计费规则"})
    @NotBlank(message = "停车场计费规则不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "停车场计费规则长度不能超过{max}位", groups = DefaultGroup.class)
    private String billRule;
    /**
     * 机构ID
     */
    @ExcelProperty(value = {EXCEL_TITLE, "机构ID"})
    @NotBlank(message = "机构ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "机构ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String orgId;
    /**
     * 操作人
     */
    @ExcelProperty(value = {EXCEL_TITLE, "操作人"})
    @NotBlank(message = "操作人不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "操作人长度不能超过{max}位", groups = DefaultGroup.class)
    private String operator;
    /**
     * 停车场ID
     */
    @TableField("park_id")
    private String parkId;
    /**
     * 停车场名称
     */
    @TableField("park_name")
    private String parkName;
    /**
     * 停车场地址
     */
    @TableField("park_address")
    private String parkAddress;

    @Override
    public void freeData() {
        this.logId = null;
        this.sid = null;
        this.note = null;
        this.rule = null;
        this.addTime = null;
        this.updateTime = null;
        this.billRule = null;
        this.orgId = null;
        this.operator = null;
        this.parkId = null;
        this.parkName = null;
        this.parkAddress = null;
        super.freeData();
    }
}
